import { commonTitle, commonGrid, emptyGraphic } from 'vue3-common/utils/eChartsUtil'

export const foodWorkChartOption = (datasetSource: string[][]) => {
  return {
    title: commonTitle('📊成果统计'),
    graphic: emptyGraphic(datasetSource.length),
    grid: commonGrid,
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      }
    },
    legend: {},
    dataset: {
      source: datasetSource
    },
    xAxis: { type: 'category' },
    yAxis: {},
    series: [
      {
        type: 'bar',
        barWidth: '20%',
        label: {
          show: true,
          position: 'top'
        }
      },
      {
        type: 'bar',
        barWidth: '20%',
        label: {
          show: true,
          position: 'top'
        }
      }]
  }
}
